using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class ScrapReasonConfiguration : EntityTypeConfiguration<ScrapReason>
    {
        public ScrapReasonConfiguration()
        {
            ToTable("Production.ScrapReason");
            HasKey(x => x.ScrapReasonId);

            Property(x => x.ScrapReasonId)
                .HasColumnName("ScrapReasonID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.Name).HasColumnName("Name").IsRequired().HasMaxLength(50);
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}